{% extends 'base.html' %}
{% block title %} - Manage video{% endblock %}

{% block content %}
<div id="content" style="position:absolute; top:20px; left:0px; width:810px; background-color: #1A1A1A; layer-background-color: #1A1A1A;">

<table width="810">
	<tr>
		<td colspan="2"><p><span style="font-size:14px;color:#CCC">Manage assets</span></p></td>
		<td colspan="3" align="left"><p> {% if videos.has_previous %} <a href="?page={{ videos.previous_page_number }}" title="Previous page"><<<</a> {% endif %}
			Page {{ videos.number }} of {{ videos.paginator.num_pages }}.
			{% if videos.has_next %}<a href="?page={{ videos.next_page_number }}" title="Next page">>>></a>{% endif %} </p>
	    </td>
    </tr>
	<tr>
		<th width="120">Name</th>
		<th width="100">Time & date</th>
		<th width="100"> Type </th>
		<th width="230">Description</th>
		<th width="50" align="center">Creator</th>
        <th width="40" align="center">Delete</th>		
	</tr>
	{% for video in videos.object_list %}
	<tr>
		<td><a href="/asset/{{video.id}}/" title="Play video">[ {{video.title}} ]</a></td>
		<td width="absolute">{{video.time|date:"H:i Y-m-d"}}</td>
		<td>{% if video.type == 0 %} Video {%else%} {% if video.type == 1 %}Image {%else%}Attachment{%endif%}{%endif%}</td>
		<td>{{video.text|safe|slice:"70"}}</td>
		<td width="absolute" align="center">{{video.user.username}}</td>

		<td width="absolute" align="center">
		{% if user.username == 'kth' %}
			<a href="/user/videos/delete/{{video.id}}/" title="Delete video" onclick="return confirm('Delte this video?');"><img src="/site_media/img/trash.gif"></a>
		{% endif %}
			<!--  a href="/user/videos/edit/{{video.id}}/" title="Edit video"><img src="/site_media/img/approve.gif"></a-->
		</td>
        
	</tr>
	{% endfor %}
    <tr><td colspan="5">
	<FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"> </FORM> 
    </td></tr>
</table>

</div>
{% endblock %}